﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Diagnostics;

namespace Game1_Resist50
{
    abstract class GameObject
    {
        // Interface.
        abstract public int ObjectWidth();
        abstract public int ObjectHeight();
        abstract public void UpdatePosition();
        abstract public Bitmap ObjectImage();
        abstract public Rectangle ObjectRectangle();

        // random.
        static protected Random _rand = new Random(System.DateTime.Today.Millisecond);
        
        // position.
        protected Point _position = new Point(
            _rand.Next(0, GraphicsHelper.BmpWidth), 
            _rand.Next(0, GraphicsHelper.BmpHeight));
        public int X
        {
            get
            {
                return _position.X;
            }
            set
            {
                _position.X = value;
            }
        }
        public int Y
        {
            get
            {
                return _position.Y;
            }
            set
            {
                _position.Y = value;
            }
        }
        public Point Position
        {
            get
            {
                return _position;
            }
            set
            {
                _position = Position;
            }
        }

        static protected int _maxOffset = GraphicsHelper.BmpWidth * 2 / 100;
        static public int MaxOffset
        {
            get
            {
                return _maxOffset;
            }
        }
    }
}
